<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
	<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
	<title>目录-添加</title>
</head>
    <base href="<?php echo base_url().'views/style/'; ?>" />
    <link href="./css/media.css" rel="stylesheet">
    <script src="./js/jquery-1.8.2.min.js"></script>
    <script src="./js/media.js"></script>
    <script src="./js/copy.js"></script>
    <script src="./js/validate.js"></script>
    <style>
     table.table1 tr th{
     	text-align: center;
     	vertical-align: top;
     }
     
    </style>
<body>
	<div class="wrap">
	   <div class="menu_list">
	    <ul>
		  <li><a href="<?php echo site_url('structure/struct_list'); ?>"> 栏目列表 </a></li>
		  <li><a href="javascript:;" class='action'>新增</a></li> 
		</ul> 
	   </div>
	   <form action="<?php echo site_url('structure/struct_add'); ?>" method="post">
		   	<table class="table1 hd-form">
		   	  

		   	 <tr>
		   	    <th class='w100'>上级栏目</th>
		   		<td>
		   		<select name="st_pid" class="w200">
		   		    <option value="0">一级栏目</option>
		   		    <?php foreach ($structs as $k => $v): ?>
		   		    	<option value="<?php echo $v['st_id'] ?>" <?php if($st_pid == $v['st_id']): ?>selected='selected' <?php endif; ?>>
		   		    	   <?php echo $v['html'].'|--'.$v['st_title'] ?>
		   		    	</option>
		   		    <?php endforeach ?>
		   		</select>
		   		</td>
		   	 </tr>



		   	  <tr>
		   	    <th class='w100'>机构名称</th>
		   		<td>
		   		   <input type="text" name="st_title" value="" style="width:185px;"/>
		   		</td>
		   	 </tr>
 

		   	   <tr>
		   	     <th class='w100'>URL地址</th>
		   	 	<td>
		   	 	   <input type="text" name="st_url" value="" style="width:185px;"/>
		   	 	</td>
		   	  </tr>


			<tr>
		   	    <th class='w100'>排序</th>
		   		<td>
		   			<input type="text" name="st_sort" style='width:185px;' value="255" />
		   		</td>
		   	 </tr> 
		   	 <tr>
		   	    <th class='w100' style="text-indent:-9999px;">操作</th>
		   		<td>
		   		    <input type="submit" class="btn1" value=" 确定提交 "/>
		   		</td>
		   	 </tr>
           </table>
	   </form>  
	</div>
	<script>
	       $(function(){
	       $("form").validate({
			    st_title: {
			      rule: {
			        required: true
			    },
			    error: {
			       required: " 机构名称不能为空! "
			    },
			    message: " 请填写机构名称",
			    success: "正确"
			   },	
			   st_url :{
			   	message: " 请填写正确的url链接",
			   	success: "正确"
			   } ,  
			   st_sort: {
			      rule: {
			        required: true
			    },
			    error: {
			       required: " 排序不能为空! "
			    },
			    message: " 请输入排序!,默认255,数字越小,优先级越高",
			    success: "正确"
			   }
				})   
			});
	</script>
</body>
</html>